<!DOCTYPE html>
<head >
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta charset="utf-8"/>
    <title>新增字典</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="../../../layuiadmin/layui/css/layui.css"  media="all"/>
    <link rel="stylesheet" href="../../../layuiadmin/style/admin.css" media="all"/>
   <link rel="stylesheet"  href="../../../css/common/loader.css" media="all"/>
   <link rel="stylesheet"  href="../../../css/common/openshow.css" media="all"/>
</head>
<body> 
<form class="layui-form layui-form-pane label-w6" action="" id="saveForm" lay-filter="saveForm">

<input type="hidden" name="dictIndexId"   />
  <div class="layui-form-item">
    <label class="layui-form-label">字典标识 </label>
    <div class="layui-input-block">
      <input type="text" name="dictKey" id="dictKey" disabled autocomplete="off"  class="layui-input">
    </div>
  </div>
  <div class="layui-form-item">
    <label class="layui-form-label">字典名称 </label>
    <div class=layui-input-block>
      <input type="text" name="dictName" id="dictName" disabled   autocomplete="off" class="layui-input">
    </div>
  </div>
 
  <div class="layui-form-item">
    <label class="layui-form-label">对照码初值 <span>*</span></label>
    <div class=layui-input-block>
      <input type="text" name="firstDictCode" lay-verify="required|pureNum|max:5" placeholder="系统会根据代码初值进行格式判断,如0,00,000,0000,00000"    autocomplete="off" class="layui-input">
    </div>
  </div>
   <div class="layui-form-item">
    <label class="layui-form-label layui-textarea-label" >字典对照值 <span>*</span></label>
    <div class="layui-input-block">
      <textarea name="dictValue" lay-verify="required|max:400"  placeholder="请输入字典对照值 ，多个使用英文逗号分隔" class="layui-textarea"></textarea>
    </div>
   </div>
  </div>

  <!-- 隐藏域 -->
   <div class="layui-form-item" style="display:none;">
    <button class="layui-btn"  lay-submit="" lay-filter="saveSubmit">提交</button>
  </div>
</form>
  <script   src="../../../layuiadmin/layui/layui.js"></script>
<script type="text/javascript" src="../../../lib/jQuery-2.2.0.min.js" ></script>
	<script>
	layui.config({
		base :  '../../../layuiadmin/' //静态资源所在路径
	}).extend({
		webplus : 'lib/webplus', //主入口模块
	}).use([ 'form','webplus' ], function() {
	    var webplus=layui.webplus;
	    webplus.doAjax('mongo/dict/addDict',{id:webplus.getUrlType().id},'','0','',function(res){
			if(webplus.isEmpty(res.data)) return false;
			// 处理后的数据赋值
			webplus.setFormData("saveForm",res.data);
		})
		webplus.initForm('system/dict/batchSaveDict','','',function(data){
		 webplus.reloadTable('1','submitDict'); //刷新父页面的table
    		
		});
		
	});

	</script>
</body>
</html>